{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

{/* import Js,Css */}
	<js href="__PUBLIC__/Js/admin/listTable.js"/>
	<js href="__PUBLIC__/Js/admin/js.util.js"/>
	<css href="__PUBLIC__/Css/admin/common.css"/>
	<js href="__PUBLIC__/Js/admin/js.selectzone.js"/>
	
	<css href="__PUBLIC__/Css/jquery-ui.css" />
	<js href="__PUBLIC__/Js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/Js/core/plugins.js"/>
{/* import Js,Css */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<form action="__URL__/operate" method="post" name="theForm">
	<div class="list-div" style="margin-bottom: 5px">
		<table width="100%" cellpadding="3" cellspacing="1">
			<tbody>
				<tr>
					<td colspan="4">
					<div align="center">
					<input type="button" onclick="window.open('__URL__/order?order_id={$order.order_id}&print=1')" value="打印订单">
					</div></td>
				</tr>
				<tr>
					<th colspan="4">基本信息</th>
				</tr>
				<tr>
					<td width="18%"><div align="right"><strong>订单号：</strong></div></td>
					<td width="34%">
						{$order.order_sn}
						
						<if condition="$order['extension_code'] eq 'group_buy'">
							<a href="group_buy.php?act=edit&id={$order.extension_id}">（团购）</a>
						<elseif condition="$order['extension_code'] eq 'exchange_goods'"/>
							<a href="exchange_goods.php?act=edit&id={$order.extension_id}">（积分兑换）</a>
						</if>
					</td>
					<td width="15%"><div align="right"><strong>订单状态：</strong></div></td>
					<td>{$order.status}</td>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>购货人：</strong></div>
					</td>
					<td>
						{$order.user_name} 
						<if condition="$order.user_id gt 0">
							[ <a href="" onclick="staticbar();return false;"> 显示购货人信息 </a> ] 
							[ <a href="user_msg.php?act=add&order_id={$order.order_id}&user_id={$order.user_id}">发送/查看留言</a> ]
						</if>
					</td>
					<td>
						<div align="right"><strong>下单时间：</strong></div>
					</td>
					<td>
						{$order.formated_add_time|}
					</td>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>支付方式：</strong></div>
					</td>
					<td>					
						<if condition="$order['pay_id'] gt 0">
							{$order.pay_name}
						<else/>	
							{$lang.require_field}
						</if>
						<a href="__URL__/edit_order?order_id={$order.order_id}&step=payment&act=edit" class="special">编辑</a>
						(备注: 
						<span onclick="listTable.edit(this, 'edit_pay_note', {$order.order_id})">
						<if condition="$order['pay_note'] neq ''">
							{$order.pay_note}
						<else/>
							N/A
						</if>
						</span>)
					</td>
					<td>
						<div align="right"><strong>付款时间：</strong></div>
					</td>
					<td>{$order.pay_time}</td>
				</tr>
				<tr>
					<td><div align="right"><strong>配送方式：</strong></div></td>
					<td>				
						<if condition="$exist_real_goods eq 1">
							<if condition="$order['shipping_id'] gt 0"> 
								{$order.shipping_name}
							<else/>
								<span class="require-field">*</span>
							</if>
							<a href="__URL__/edit_order?order_id={$order.order_id}&step=shipping&act=edit" class="special">编辑</a>&nbsp;&nbsp;
							<input type="button" onclick="window.open('order.php?act=info&order_id={$order.order_id}&shipping_print=1')" value="打印快递单">
							<if condition="$order['insure_fee'] gt 0">
								（保价费用：{$order.formated_insure_fee}）
							</if>
						</if>
					</td>
					<td><div align="right"><strong>发货时间：</strong></div></td>
					<td>{$order.shipping_time}</td>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>发货单号：</strong></div>
					</td>
					<td>					
						<if condition="$order['shipping_id'] gt 0 and $order['shipping_status'] gt 0">
							<span>
								<if condition="$order['invoice_no'] neq ''">
									{$order.invoice_no}
								<else/>
									N/A
								</if>
							</span>
							<a href="__URL__/order?order_id={$order.order_id}&step=shipping" class="special">编辑</a>
						</if>
					</td>
					<td>
						<div align="right"><strong>订单来源：</strong></div>
					</td>
					<td>{$order.referer}</td>
				</tr>
				<tr>
					<th colspan="4">其他信息<a href="__URL__/edit_order?act=edit&order_id={$order.order_id}&step=other" class="special">编辑</a></th>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>发票类型：</strong></div>
					</td>
					<td>{$order.inv_type}</td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>发票抬头：</strong></div>
					</td>
					<td>{$order.inv_payee}</td>
					<td>
						<div align="right"><strong>发票内容：</strong></div>
					</td>
					<td>{$order.inv_content}</td>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>客户给商家的留言：</strong></div>
					</td>
					<td colspan="3">{$order.postscript}</td>
				</tr>
				<tr>
					<td><div align="right"><strong>缺货处理：</strong></div></td>
					<td>{$order.how_oos}</td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td><div align="right"><strong>包装：</strong></div></td>
					<td>{$order.pack_name}</td>
					<td><div align="right"><strong>贺卡：</strong></div></td>
					<td>{$order.card_name}</td>
				</tr>
				<tr>
					<td><div align="right"><strong>贺卡祝福语：</strong></div></td>
					<td colspan="3">{$order.card_message}</td>
				</tr>
				<tr>
					<td><div align="right"><strong>商家给客户的留言：</strong></div></td>
					<td colspan="3">{$order.to_buyer}</td>
				</tr>
				<tr>
					<th colspan="4">收货人信息<a href="__URL__/edit_order?act=edit&order_id={$order.order_id}&step=consignee" class="special">编辑</a></th>
				</tr>
				<tr>
					<td><div align="right"><strong>收货人：</strong></div></td>
					<td>{$order.consignee}</td>
					<td><div align="right"><strong>电子邮件：</strong></div></td>
					<td>{$order.email}</td>
				</tr>
				<tr>
					<td>
						<div align="right"><strong>地址：</strong></div>
					</td>
					<td>
						[{$order.region}] {$order.address}
					</td>
					<td>
						<div align="right"><strong>邮编：</strong></div>
					</td>
					<td>{$order.zipcode}</td>
				</tr>
				<tr>
					<td><div align="right"><strong>电话：</strong></div></td>
					<td>{$order.tel}</td>
					<td><div align="right"><strong>手机：</strong></div></td>
					<td>{$order.mobile}</td>
				</tr>
				<tr>
					<td><div align="right"><strong>标志性建筑：</strong></div></td>
					<td>{$order.sign_building}</td>
					<td><div align="right"><strong>最佳送货时间：</strong></div></td>
					<td>{$order.best_time}</td>
				</tr>
			</tbody>
		</table>
	</div>

	<div style="width:100%; height:2px; background:blue;"></div>
	<!-- 商品信息 -->
	<div class="list-div" style="margin-bottom: 5px">
		<table width="100%" cellpadding="3" cellspacing="1">
			<tbody>
				<tr>
					<th colspan="8" scope="col">
						商品信息<a href="__URL__/edit_order?act=edit&order_id={$order.order_id}&step=goods" class="special">编辑</a>
					</th>
				</tr>
				<tr>
					<td scope="col"><div align="center"><strong>商品名称 [ 品牌 ]</strong></div></td>
					<td scope="col"><div align="center"><strong>货号</strong></div></td>
					<td scope="col"><div align="center"><strong>货品号</strong></div></td>
					<td scope="col"><div align="center"><strong>价格</strong></div></td>
					<td scope="col"><div align="center"><strong>数量</strong></div></td>
					<td scope="col"><div align="center"><strong>属性</strong></div></td>
					<td scope="col"><div align="center"><strong>库存</strong></div></td>
					<td scope="col"><div align="center"><strong>小计</strong></div></td>
				</tr>
				<volist name="goods_list" id="goods">
				<tr>
					<td>
						<a href="../goods.php?id=24" target="_blank">P806 [ 联想 ]        </a>
						<if condition="$goods['goods_id'] gt 0 and $goods['extension_code'] neq 'package_buy'">
							{$goods.goods_name}
							<if condition="$goods['brand_name'] neq ''">
								[ {$goods.brand_name} ]
							</if>
							<if condition="$goods['is_gift'] eq 1 and $goods['goods_price'] gt 0">
								（特惠品）
							<else/>
								（赠品）
							</if>
							<if condition="$goods['parent_id'] gt 0">
								（配件）
							</if>
						<elseif condition="$goods['goods_id'] gt 0 and $goods['extension_code'] eq 'package_buy'"/>
							<a href="javascript:void(0)" onclick="setSuitShow({$goods.goods_id})">
								{$goods.goods_name}
								<span style="color:#FF0000;">（礼包）</span>
							</a>
							<div id="suit_{$goods.goods_id}" style="display:none">
								<volist name="$goods['package_goods_list']" id="package_goods_list">
									<a href="../goods.php?id={$package_goods_list.goods_id}" target="_blank">
										{$package_goods_list.goods_name}
									</a>
									<br/>
								</volist>
							</div>
						</if>
					</td>
					<td>{$goods.goods_sn}</td>
					<td>{$goods.product_sn}</td>
					<td><div align="right">{$goods.formated_goods_price}</div></td>
					<td><div align="right">{$goods.goods_number}</div></td>
					<td>{$goods.goods_attr}<br>
					</td>
					<td><div align="right">{$goods.storage}</div></td>
					<td><div align="right">{$goods.formated_subtotal}</div></td>
				</tr>
				</volist>
				<tr>
					<td></td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
					<td>
						<if condition="$order['total_weight'] neq 0">
							<div align="right">
								<strong>
									{$lang.label_total_weight}
								</strong>
							</div>
						</if>
					</td>
					<td>
						<if condition="$order['total_weight'] neq 0">
							<div align="right">
								<strong>
									{$lang.label_total_weight}
								</strong>
							</div>
						</if>
					</td>
					<td>&nbsp;</td>
					<td>
						<div align="right"><strong>合计：</strong></div>
					</td>
					<td>
						<div align="right">{$order.formated_goods_amount}</div>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<div style="width:100%; height:2px; background:blue;"></div>
	<!-- 商品信息 -->

	<!-- 费用信息 -->
	<div class="list-div" style="margin-bottom: 5px">
		<table width="100%" cellpadding="3" cellspacing="1">
			<tbody>
				<tr>
					<th>
						费用信息
						<a href="__URL__/edit_order?act=edit&order_id={$order.order_id}&step=money" class="special">编辑</a>
					</th>
				</tr>
				<tr>
					<td>
						<div align="right">
							商品总金额：<strong>{$order.formated_goods_amount}</strong>
							- 折扣：	<strong>{$order.formated_discount}</strong>    
							+ 发票税额：<strong>{$order.formated_tax}</strong>
							+ 配送费用：<strong>{$order.formated_shipping_fee}</strong>
							+ 保价费用：<strong>{$order.formated_insure_fee}</strong>
							+ 支付费用：<strong>{$order.formated_pay_fee}</strong>
							+ 包装费用：<strong>{$order.formated_pack_fee}</strong>
							+ 贺卡费用：<strong>{$order.formated_card_fee}</strong>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div align="right"> = 订单总金额：<strong>{$order.formated_total_fee}</strong></div>
					</td>
				</tr>			
				<tr>
					<td>
						<div align="right">
							- 已付款金额：
							<strong>{$order.formated_money_paid}</strong> 
							- 使用余额：
							<strong>{$order.formated_surplus}</strong>
							- 使用积分：
							<strong>{$order.formated_integral_money}</strong>
							- 使用红包：
							<strong>{$order.formated_bonus}</strong>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div align="right"> 
							<if condition="$order['order_amount'] egt 0">
								=应付款金额：
								<strong>{$order.formated_order_amount}</strong>
							<else/>
								{$lang.label_money_refund}
								<strong>{$order.formated_money_refund}</strong>
								<input name="refund" type="button" value="{:L('refund')}" 
									   onclick="location.href='__URL__/process?func=load_refund&anonymous=<if condition="$order['user_id'] elt 0">1<else/>0</if>&order_id={$order.order_id}&refund_amount={$order.money_refund}'" />
							</if>
							<if condition="$order['extension_code'] eq 'group_buy'">
								<br/>{$lang.notice_gb_order_amount}
							</if>
						</div>
					</td>
				</tr>
				<tr>
					<td align="right">
						（备注：团购如果有保证金，第一次只需支付保证金和相应的支付费用）
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<div style="width:100%; height:2px; background:blue;"></div>
	<!-- 费用信息 -->

	<!-- 操作 -->
	<div class="list-div" style="margin-bottom: 5px">
		<table cellpadding="3" cellspacing="1" width="100%" border="1">
			<tbody>
				<tr>
					<th colspan="6">操作信息</th>
				</tr>
				<tr>
					<td>
						<div align="right">
							<strong>操作备注：</strong></div>
						</td>
					<td colspan="5">
						<textarea name="action_note" cols="80" rows="3"></textarea>
					</td>
				</tr>
				<tr>
					<td>
						<div align="right"></div>
						<div align="right"><strong>当前可执行操作：</strong> </div>
					</td>
					<td colspan="5">  					
						<if condition="$operable_list['confirm'] eq 1">
							<input name="confirm" type="submit" value="确认"  />
						</if>
						<if condition="$operable_list['pay'] eq 1">
							<input name="pay" type="submit" value="付款"  />
						</if>
						<if condition="$operable_list['unpay'] eq 1">
							<input name="unpay" type="submit" value="设为未付款" />
						</if>
						<if condition="$operable_list['prepare'] eq 1">
							<input name="prepare" type="submit" value="配货" />
						</if>
						<if condition="$operable_list['split'] eq 1">
							<input name="ship" type="submit" value="生成发货单" />
						</if>					
						<if condition="$operable_list['unship'] eq 1">
							<input name="unship" type="submit" value="未发货" />
						</if>
						<if condition="$operable_list['receive'] eq 1">
							<input name="receive" type="submit" value="已收货" />
						</if>
						<if condition="$operable_list['cancel'] eq 1">
							<input name="cancel" type="submit" value="取消" />
						</if>
						<if condition="$operable_list['invalid'] eq 1">
							<input name="invalid" type="submit" value="无效" />
						</if>
						<if condition="$operable_list['return'] eq 1">
							<input name="return" type="submit" value="退货" />
						</if>
						<if condition="$operable_list['to_delivery'] eq 1">
							<input name="to_delivery" type="submit" value="去发货" />
							<input name="order_sn" type="hidden" value="{$order.order_sn}" />
						</if>
						<input name="after_service" type="submit" value="售后" />
						<if condition="$operable_list['remove'] eq 1">
							<input name="remove" type="submit" value="删除" onClick="return window.confirm('删除订单将清除该订单的所有信息。您确定要这么做吗？');" />
						</if>
						<if condition="$order['extension_code'] eq 'group_buy'">
							备注：团购活动未处理为成功前，不能发货
						</if>					
						<input name="assign" type="submit" value="指派给" onclick="return assignTo(document.forms['theForm'].elements['agency_id'].value)">					
						<select name="agency_id">
							<option value="0">请选择...</option>
							<volist name="agencyList" id="agency">
							<option value="{$agency.agency_id}">{$agency.agency_name}</option>
							</volist>
						</select>
						<input name="order_id" type="hidden" value="{$order.order_id}">
					</td>
				</tr>
				<tr>
					<th>操作者：</th>
					<th>操作时间</th>
					<th>订单状态</th>
					<th>付款状态</th>
					<th>发货状态</th>
					<th>备注</th>
				</tr>
				<volist name="action_list" id="action">
				<tr>
					<td><div align="center">{$action.action_user}</div></td>
					<td><div align="center">{$action.action_time}</div></td>
					<td><div align="center">{$action.order_status}</div></td>
					<td><div align="center">{$action.pay_status}</div></td>
					<td><div align="center">{$action.shipping_status}</div></td>
					<td>{$action.action_note}</td>
				</tr>
				</volist>
			</tbody>
		</table>
	</div>
	<div style="width:100%; height:2px; background:blue; margin-bottom:50px;"></div>
</form>
<!-- 操作 -->

